from PyQt5.QtWidgets import QToolBar
from PyQt5.QtGui import QCloseEvent

class EToolBar(QToolBar):

    def __init__(self, parent=None, *args, **kwargs):
        super(EToolBar, self).__init__(parent, *args, **kwargs)

    def closeEvent(self, a0: QCloseEvent) -> None:
        a0.setAccepted(False)
        return